home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / biz / dopus / VisageShow.lha / VisageShow.dopus5 next >
Text File  |  1997-09-05  |  2KB  |  83 lines

  1. /*
  2.  $VER: VisageShow.dopus5 1.0 (01.9.97)
  3.  Written by Tommy Jensen
  4.  Nicer way to view pictures with Visage from Opus5
  5.  Call as:
  6.  <AREXX>DOpus5:ARexx/VisageShow.dopus5
  7. */
  8.  
  9. /* Change this to the path where Visage is located */
  10. Visage = Visage
  11.  
  12. /* Change these options to suit ypur needs */
  13. visopts = NOBUSY CENTRE WBMONITOR BUFSIZE 256 NOICON
  14.  
  15. options results
  16.  
  17. if Show("P","DOPUS.1") then
  18.  address "DOPUS.1"
  19. Else Do
  20.  exit
  21.  end
  22.  
  23. dopus version
  24. If ( result='RESULT' | translate(result,'.',' ') < 5.1218 ) then do
  25.     dopus request '"This script requires DOpus v5.5 or greater." OK'
  26.  exit
  27.  end
  28.  
  29. lister query source
  30. slist=result
  31.  
  32. lister query slist path
  33. picpath=result
  34.  
  35. lister query slist selfiles stem pics.
  36. if pics.count=0 then do
  37.  lister request slist '"No selected files."' 'OK'
  38.  exit
  39.  end
  40.  
  41. totsel = pics.count-1
  42.  
  43. /* Get Visage to produce output for us to grab the version string */
  44. address command 'visage >pipe:visout produceoutput'
  45. Call Open('bozo', 'pipe:visout', 'R')
  46. clown = ReadCh('bozo', 89)
  47. visver = SUBSTR(clown,4,12)
  48. visauth = SUBSTR(clown,32,18)
  49. Call Close('bozo')
  50.  
  51. versauth = visver' 'visauth
  52.  
  53. dopus front
  54.  
  55. lister set slist busy on
  56. lister set slist newprogress name info title bar abort
  57. lister set slist newprogress title versauth
  58. lister set slist newprogress info 'Viewing files...'
  59.  
  60. number = 0
  61.  if pics.count ~=0 then do
  62.   do until number = pics.count
  63.    pic=pics.number
  64.    lister set slist newprogress bar totsel number
  65.    lister set slist newprogress info 'Rendering 'pic'...'
  66.    address command Visage' >pipe:visout 'visopts picpath''pic''
  67.    Call Open('bozo', 'pipe:visout', 'R')
  68.    clown = ReadCh('bozo', 89)
  69.    dims = SUBSTR(clown,61,12)
  70.    lister set slist newprogress name 'File: 'pic'  Dims: 'dims
  71.    Call Close('bozo')
  72.    lister select slist pic 0
  73.    lister refresh slist
  74.    lister query slist abort
  75.    if result then call EXIT
  76.    number = number + 1
  77.   end
  78.  EXIT:
  79.       lister refresh slist
  80.       lister set slist busy off
  81.       exit
  82.       end 
  83.